import { LoadingOutlined } from "@ant-design/icons";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// import Loadable from 'react-loadable'
import { lazy } from 'react'
// 导入路由组件
import Home from '@/pages/home/Index'
import Login from '@/pages/login/Index'
// 基础设置
const BasicSettingsNav = lazy(() => import('@/pages/basicSettings/Navigation'))
// const BasicSettingsNav = Loadable({
// 	loader: () => import('@/pages/basicSettings/Navigation'),
// 	loading: <LoadingOutlined />
// })
const Auth = lazy(() => import('@/pages/basicSettings/Auth'))
const User = lazy(() => import('@/pages/basicSettings/User'))
const Dictionary = lazy(() => import('@/pages/basicSettings/Dictionary'))
const Process = lazy(() => import('@/pages/basicSettings/Process'))
const CustomFrom = lazy(() => import('@/pages/basicSettings/CustomFrom'))
const FormSettings = lazy(() => import('@/pages/basicSettings/FormSettings'))
// 商城
const SettleIn = lazy(() => import('@/pages/store/settleIn/Index'))
const Shop = lazy(() => import('@/pages/store/shop/Index'))
const Pub = lazy(() => import('@/pages/store/pub/Index'))
const StoreManage = lazy(() => import('@/pages/store/manage/Index'))
const StoreCoupon = lazy(() => import('@/pages/store/coupon/Index'))
const StoreStatistics = lazy(() => import('@/pages/store/statistics/Index'))
const UserOrderManage = lazy(() => import('@/pages/store/userOrder/Manage'))
const UserOrderPayment = lazy(() => import('@/pages/store/userOrder/Payment'))
const UserOrderDelivery = lazy(() => import('@/pages/store/userOrder/Delivery'))
const UserOrderRecord = lazy(() => import('@/pages/store/userOrder/Record'))
const UserOrderTakeDelivery = lazy(() => import('@/pages/store/userOrder/TakeDelivery'))
const MyOrderManage = lazy(() => import('@/pages/store/myOrder/Manage'))
const MyOrderPayment = lazy(() => import('@/pages/store/myOrder/Payment'))
const MyOrderDelivery = lazy(() => import('@/pages/store/myOrder/Delivery'))
const MyOrderRecord = lazy(() => import('@/pages/store/myOrder/Record'))
const MyOrderTakeDelivery = lazy(() => import('@/pages/store/myOrder/TakeDelivery'))
//文章
const ArticleFan = lazy(() => import('@/pages/article/Fan'))
const ArticleFollow = lazy(() => import('@/pages/article/Follow'))
const ArticleMange = lazy(() => import('@/pages/article/Mange'))
const ArticleStatistics = lazy(() => import('@/pages/article/Statistics'))
//会员
const VipManage = lazy(() => import('@/pages/vip/Index'))
//首页
const Chart = lazy(() => import('@/pages/home/chart'))
//直播
const Live = lazy(() => import('@/pages/live/Index'))
// 导入路由管理工具
import { Navigate } from 'react-router-dom'

const baseBouter = [
	{
		path: '/login',
		element: <Login />,
	},
	{
		path: '/',
		element: <Navigate to="/home" />,
	},
	{
		path: '/home',
		label: '首页',
		element: <Home />,
		children: [
			{
				path: '/home',
				label: '统计',
				element: <Chart />,
			},
			{
				path: 'basicSettings',
				label: '基础设置',
				children: [
					{
						path: 'settingsNav',
						label: '导航管理',
						element: <BasicSettingsNav />
					},
					{
						path: 'auth',
						label: '权限设置',
						element: <Auth />
					},
					{
						path: 'user',
						label: '用户管理',
						element: <User />
					},
					{
						path: 'dictionary',
						label: '数据字典',
						element: <Dictionary />
					},
					{
						path: 'process',
						label: '流程管理',
						element: <Process />
					},
					{
						path: 'customFrom',
						label: '表单配置',
						element: <CustomFrom />
					},
					{
						path: 'formSettings',
						label: '窗体设计',
						element: <FormSettings />
					}
				]
			},
			{
				path: 'store',
				label: '商城',
				children: [
					{
						path: 'settleIn',
						label: '商家入驻',
						element: <SettleIn />
					},
					{
						path: 'shop',
						label: '商店',
						element: <Shop />
					},
					{
						path: 'pub',
						label: '发布商品',
						element: <Pub />
					},
					{
						path: 'manage',
						label: '商品管理',
						element: <StoreManage />
					},
					{
						path: 'coupon',
						label: '优惠券管理',
						element: <StoreCoupon />
					},
					{
						path: 'statistics',
						label: '用户统计',
						element: <StoreStatistics />
					},
					{
						path: 'userOrder',
						label: '用户订单',
						element: <Shop />,
						children: [
							{
								path: 'manage',
								label: '订单管理',
								element: <UserOrderManage />
							},
							{
								path: 'payment',
								label: '待付款',
								element: <UserOrderPayment />
							},
							{
								path: 'delivery',
								label: '待发货',
								element: <UserOrderDelivery />
							},
							{
								path: 'takeDelivery',
								label: '待收货',
								element: <UserOrderRecord />
							},
							{
								path: 'record',
								label: '购买记录',
								element: <UserOrderTakeDelivery />
							},
						]
					},
					{
						path: 'order',
						label: '我的订单',
						element: <Shop />,
						children: [
							{
								path: 'manage',
								label: '订单管理',
								element: <MyOrderManage />
							},
							{
								path: 'payment',
								label: '待付款',
								element: <MyOrderPayment />
							},
							{
								path: 'delivery',
								label: '待发货',
								element: <MyOrderDelivery />
							},
							{
								path: 'takeDelivery',
								label: '待收货',
								element: <MyOrderRecord />
							},
							{
								path: 'record',
								label: '购买记录',
								element: <MyOrderTakeDelivery />
							},
						]
					}
				]
			},
			{
				path: 'article',
				label: '我的文章',
				children: [
					{
						path: 'statistics',
						label: '文章统计',
						element: <ArticleFan />
					},
					{
						path: 'mange',
						label: '文章管理',
						element: <ArticleFollow />
					},
					{
						path: 'fan',
						label: '文章统计',
						element: <ArticleMange />
					},
					{
						path: 'follow',
						label: '我的关注',
						element: <ArticleStatistics />
					}
				]
			},
			{
				path: 'vip',
				label: '会员管理',
				element: <VipManage />
			},
			{
				path: 'live',
				label: '直播',
				element: <Live />
			},
		]
	},

]

export default baseBouter;